Metrics Visualisation and analysis on individuals video+LAM

Author

Angelique Porciani

Published

Last Updated on 02 October, 2024

Code
# load package----

library(tidyverse)
library(patchwork)
library(kableExtra)
library(gtsummary)
library(FactoMineR)
library(glmmTMB)
library(factoextra)

# load data ---- 

res_by_ind_spatial <- read.delim("../Data_larvae/data_larves_1hr/Results/Spatial/Element_Tous_bords_0.csv",
                                 ,
                                 sep = ";") %>% 
  separate(Video, c("Camera", "FPS", "Replicat"), remove=FALSE)

res_by_ind <- read.delim("../Data_larvae/data_larves_1hr/Results/Results_by_ind.csv",
                                 ,
                                 sep = ";") %>% 
  separate(Video, c("Camera", "FPS", "Replicat"), remove=FALSE) %>% 
  select(!c(25:29))


corres_ID <- read_csv2("../Corr_coord_data/corres_Arena_ID.csv") %>% 
  select(c(1,2))

corres_ttmt <- read_csv2("../corr_traitement_plaque.csv")%>% 
  select(c(1:4))

## ID attribution 
corres_ID <- corres_ID %>% 
  mutate(Arena=as.numeric(str_extract(Arena, "\\d.*")))

res_by_ind <- res_by_ind %>%
  inner_join(corres_ID) 

res_by_ind <- res_by_ind %>% 
  mutate(Plaque=as.numeric(str_extract(ID, "\\d+"))) %>% 
  inner_join(corres_ttmt) %>% mutate(End_seq_min=as.numeric(End_seq)/60) %>% 
  mutate(fullID = str_c(Camera, Replicat, ID))
                                    

res_by_ind_spatial <- res_by_ind_spatial %>%
  inner_join(corres_ID) 

res_by_ind_spatial <- res_by_ind_spatial %>% 
  mutate(Plaque=as.numeric(str_extract(ID, "\\d+"))) %>% 
  inner_join(corres_ttmt)%>% mutate(fullID = str_c(Camera, Replicat, ID))

# taille des larves 

taille_larv <- read.csv("../Data_larvae/20240820_mesures_larves.csv")

# metadata 
metadata <- read_csv2("../Data_larvae/20240807_meta_data.csv")

metadata <- metadata %>% separate(ID, c("Camera", "ID2")) 
metadata <- metadata %>%  mutate(Camera=str_to_lower(Camera), fullID=paste0(Camera,ID2))

# tri des id qui sont en LAM 
# suppresion des ID qui sont pas dans les LAM et virer le replicat 05
metadata_sub <-  metadata %>% drop_na(position_LAM) %>% filter(replicat!=5)

data_LAM_vid_spatial <- inner_join(metadata_sub, res_by_ind_spatial)

data_LAM_vid <- inner_join(metadata_sub, res_by_ind, by=c("Camera","fullID"))

data_LAM_vid <- data_LAM_vid %>% mutate(fullID2=paste0(Arena, fullID)) %>% 
  mutate(fullID3=gsub("[^0-9]", "", as.character(fullID2))
)

res_bout_Mspeed<- read_csv("../Data_larvae/data_larves_1hr/res_bouts_Mspeed.csv") %>% 
  dplyr::select(!1) %>% mutate_at(vars(Max_bout_activ, Max_bout_inactiv, Max_Speed), as.numeric)

data_LAM_vid <-data_LAM_vid %>%  inner_join(res_bout_Mspeed)

Ce script présente les analyses concernant les données video acquise dans le cadre du projet ANR INDeed. Les analyses sont ici basée sur tous les individus filmé dont la proportion de temps de tracking perdu est inférieur à 20% et qui dont l’activité en LAM a pu être enregistrée.

Video acquisition

The video were acquiried with a setup described in detail in supplementary data. Basically, it is based on RapsberryPi 4 and a camera IR cut with an objective of 2.8cm focus. Image are acquired at 10fps rate.

Video tracking parameters

All the tracking was made using AnimalTA software (source). The step of plate installation was removed from the video. The length of the video was limited to 3600 s for each replicate. Relative background substraction method was applied (hungarian algo I think, need to validate this). Arena were defined by hand.

Parameters needed to do the tracking with the software :

  • color correction : none, keep original color.

  • correction of light : yes

  • Threshold : 19-30 depending on the video

  • Background : relative background substraction with individual darker than background.

  • Max distance : 3.5-3.7 cm

  • Erosion/dilatation : 0

  • Surface : 56.8cm2

  • Nb ID by arena : 1

Analysis

Analysis description

This document contains a description of the video data of larvae Anopheles gambiae s.s. kdr mutant L3-L4 stage.

Analysis are based on parameters that described the navigatory behaviour of larvae during 1 hour in a circle containers (3cm diameter). Analysis was made on 3 sequences : 1/ complete 1 hour, 2/ time needed to explore 90% of the surface and 3/ 90% of exploration to the end of recording (3600s). All video were cropped to have the same time lenght.

Analysis is divided in two mains parts :

- Analysis of results of navigation in the total of the container surface

- Analysis of results in the surface close to border (1 cm to the border).

Number of individuals

Code
data_LAM_vid%>% filter(Sequence=="General") %>% drop_na(traitement) %>% 
  group_by(traitement) %>% summarise(Nmosquitoes=n()) %>% 
  kbl(caption = "Number of mosquitoes larvae tracked and LAM acquisition for each treatment", booktabs = T)%>%
    kable_styling(full_width = T)
Number of mosquitoes larvae tracked and LAM acquisition for each treatment
traitement Nmosquitoes
eau 76
perm 77
Code
data_LAM_vid%>% filter(Sequence=="General" & Prop_time_lost < 0.20) %>%
  group_by(traitement) %>% summarise(Nmosquitoes=n()) %>% 
  kbl(caption = "Number of mosquitoes with less than 20% of time lost during tracking and LAM acquisition for each treatment", booktabs = T)%>%
    kable_styling(full_width = T)
Number of mosquitoes with less than 20% of time lost during tracking and LAM acquisition for each treatment
traitement Nmosquitoes
eau 72
perm 71
Code
data_LAM_vid %>% filter(Sequence=="General" & Prop_time_lost < 0.20) %>% 
  group_by(Replicat, Traitement) %>% summarise(Nmosquitoes=n()) %>% 
  kbl(caption = "Number of mosquitoes with less than 20% of time lost during tracking for each replicate and treatment", booktabs = T)%>%
    kable_styling(full_width = T)
Number of mosquitoes with less than 20% of time lost during tracking for each replicate and treatment
Replicat Traitement Nmosquitoes
R06 Control 10
R06 Permethrin 9
R08 Control 8
R08 Permethrin 8
R09 Control 16
R09 Permethrin 18
R10 Control 19
R10 Permethrin 19
R11 Control 17
R11 Permethrin 19
Code
# data_LAM_vid %>% filter(Sequence=="General" & Prop_time_lost < 0.20) %>% 
#   dplyr::select(Replicat, Traitement, fullID3) %>% 
#   # kbl(caption = "Number of mosquitoes with less than 20% of time lost during tracking for each replicate and treatment", booktabs = T)%>%
#   #kable_styling(full_width = T) %>% 
#   data_frame() %>% 
#   write.csv("../ID_selected_MoveR.csv")

data_LAM_vid%>% filter(Sequence=="General" & Prop_time_lost < 0.20) %>% 
  group_by(Traitement, sexe) %>% summarise(Nmosquitoes=n()) %>% 
  kbl(caption = "Number of mosquitoes with less than 20% of time lost during tracking for each replicate and treatment", booktabs = T)%>%
    kable_styling(full_width = T)
Number of mosquitoes with less than 20% of time lost during tracking for each replicate and treatment
Traitement sexe Nmosquitoes
Control F 39
Control M 29
Control NA 2
Permethrin F 35
Permethrin M 31
Permethrin NA 7

Number of individual alive until LAM for each treatement and replicate

Code
# estimation of number alive until LAM for water and permethrin exposition 

metadata %>% dplyr::filter(replicat!=5 & replicat!=7) %>% dplyr::group_by(replicat,traitement) %>% 
  dplyr::filter(LAMetsurv==1) %>% summarise(n=n()) %>%   kbl(caption = "Number of mosquitoes alive until LAM recording", booktabs = T)%>%
    kable_styling(full_width = T)
Number of mosquitoes alive until LAM recording
replicat traitement n
6 eau 15
6 perm 14
8 eau 14
8 perm 14
9 eau 13
9 perm 14
10 eau 12
10 perm 9
11 eau 12
11 perm 11

Variables description

Parameters are calculated for all displacement inside the containers (named after dataset_all) and inside the zone defined along border of each containers (spatial). I choose a zone of 1cm to the border. Graphics and analysis were presented for each set of parameters (all or spatial).

Threshold for movement : Here the threshold is defined as the distance traveled between two frames higher than 0.3cm corresponding to the L3_L4 larvae body size.

Variables description
Variable Name Description Units Type of bhvr Dataset
Prop_time_lost Count the proportion of frames for which the target was not detected (appears as “NA NA” in the data tables). No units NA Both
Average_Speed The displacement speed between each frame will be calculated and averaged for the whole video/or sequence length defined. cm/frame activity Both
Average_Speed_Moving The displacement speed between each frame where the target is considered as moving (i.e. speed above the red movement threshold) will be calculated and averaged for the whole video. cm/frame Both
Prop_time_moving Proportion of time the target is considered as moving given the defined threshold. No units activity Both
Traveled_Dist Sum the total distance traveled by the target. cm activity/exploration Both
Traveled_Dist_Moving Sum the total distance traveled by the target when we only consider the frame during which the target is considered as moving. cm activity. Both
End_seq Time needed to explore 90% of the surface. Length of the sequence. (Manually defined, other option are available in AnimalTA software). (s) second exploration Ind_all
Prop_time_inside Proportion of time inside the area, here in an area of 3mm along border. No units foraging Spatial
Time_inside Number of frame (s?) inside 3mm close to border. seconds ? foraging Spatial
Nb_entries Nb of the entries in the area of 3mm close to border No units foraging Spatial
Exploration_absolute_value surface in cm2 explored by the larvae in a given time (here 1 hour or End_seq time length). cm2 exploration (time dependant)/ not really relevant for our study as we let enough time given the container to explore all the surface ind_all
Meander Indicator of the sinusoity of the trajectories during the sequence recorded. Estimation of the meander of the trajectories. This value is the average of the change in direction (turning angle) divided by the distance traveled for each frame. foraging Both
Meander_moving same as Meander but only for movement Foraging ? Both
Latency The latency to approach the border(s) at less than the indicated distance (1cm here) Rest ? Spatial
Max_bout_inactiv Maximal length (in frame) without movement >0.3cm/s physiological/activity intensity ind_all
Max_speed Maximal speed recorded (cm/s) physiological/activity intensity ind_all

Need precision about :

  • The method for speed average ? (moyenne glissante ? geométrique ?)

  • Units of Time inside frame or second ?

All detailed informations are available in software AnimalTA and associated guidelines.

All surface analysis

1 hour recording

The data presented are data for the whole recording and for individuals with less than 20% of time lost during recording.

Code
data_temp=subset(data_LAM_vid, Prop_time_lost < 0.20 & Sequence=="General")

loop.list <- c("Prop_time_moving", "Average_Speed", "Average_Speed_Moving", "Traveled_Dist", "Meander", "Traveled_Dist_Moving", "Meander_moving", "Max_bout_inactiv", "Max_Speed")

plot_list <- list()

for (n in loop.list)
  {
  plot_list[[n]] <- ggplot(data=data_temp)+
    geom_jitter(aes_string(x="Traitement", y=n, color="Traitement")) +
    geom_boxplot(aes_string(x="Traitement", y=n, color="Traitement"), width = 0.15, position = position_dodge(0.9)) +
     geom_violin(aes_string(x="Traitement", y=n,
                    fill = "Traitement",
                    colour="Traitement"),alpha=0.3, linewidth = 0) +
    theme_light()+
    theme(legend.position = "none", axis.title.x = element_blank())+
    ylab(paste(n))+
    scale_color_manual(
      values = c("#648FFF", "#FE6100"))+
    scale_fill_manual(
      values = c("#648FFF", "#FE6100"))
  #print(plot_list[[n]])
}

wrap_plots(plot_list[1:6], nrow=3)

Code
wrap_plots(plot_list[7:9], nrow=2)

Code
# Table of mean, sd and median 

data_temp %>% 
  tbl_summary(
    include = loop.list,
    by=Traitement,
    type = loop.list ~ "continuous2",
    statistic = all_continuous2() ~ c("{median} ({p25} - {p75}", "{mean} ({sd})"),
    digits = list(
      all_continuous2() ~ 2)
  )

Characteristic

Control
N = 70

Permethrin
N = 73

Prop_time_moving

    Median (Q1 - Q3 0.28 (0.21 - 0.36 0.29 (0.21 - 0.35
    Mean (SD) 0.28 (0.11) 0.29 (0.09)
Average_Speed

    Median (Q1 - Q3 0.33 (0.25 - 0.44 0.33 (0.25 - 0.43
    Mean (SD) 0.35 (0.13) 0.34 (0.12)
Average_Speed_Moving

    Median (Q1 - Q3 1.05 (0.96 - 1.15 1.03 (0.95 - 1.12
    Mean (SD) 1.05 (0.15) 1.03 (0.14)
Traveled_Dist

    Median (Q1 - Q3 1,163.38 (859.57 - 1,479.42 1,093.21 (810.23 - 1,445.17
    Mean (SD) 1,193.96 (473.66) 1,168.82 (417.47)
Meander

    Median (Q1 - Q3 31,743.01 (22,121.90 - 253,016,104,325.86 32,492.45 (21,057.91 - 44,292.84
    Mean (SD) 2,312,546,440,481.70 (5,206,061,772,258.69) 1,316,422,157,636.93 (5,167,609,238,377.32)
Traveled_Dist_Moving

    Median (Q1 - Q3 997.95 (705.46 - 1,292.63 933.69 (670.09 - 1,288.14
    Mean (SD) 1,036.35 (459.06) 1,008.02 (399.06)
Meander_moving

    Median (Q1 - Q3 199.27 (184.63 - 213.97 196.69 (181.97 - 207.32
    Mean (SD) 204.01 (33.28) 196.10 (26.36)
Max_bout_inactiv

    Median (Q1 - Q3 344.50 (216.00 - 565.00 355.00 (237.00 - 522.00
    Mean (SD) 446.37 (362.98) 417.60 (280.41)
Max_Speed

    Median (Q1 - Q3 7.96 (7.03 - 9.91 7.81 (6.67 - 9.06
    Mean (SD) 9.47 (5.14) 9.33 (5.32)

90% exploration

In this part are presented metrics for only the period taken to explore 90% of the area. As previously, individual with more than 20% of time lost are removed.

Code
data_temp2 <- data_LAM_vid %>% filter(Prop_time_lost < 0.20 &
             Sequence == "Seq_90")


loop.list2 <- c("Prop_time_moving", "Traveled_Dist", "Traveled_Dist_Moving", "Average_Speed", "Average_Speed_Moving", 
                "Meander_moving", "Exploration_absolute_value", "End_seq")


plot_list <- list()

for (n in loop.list2)
{
  plot_list[[n]] <- 
    ggplot(data_temp2)+
    geom_jitter(aes_string(x="Traitement", y=n, color="Traitement")) +
    geom_boxplot(aes_string(x="Traitement", y=n, color="Traitement"), width = 0.15, position = position_dodge(0.9)) +
    geom_violin(aes_string(x="Traitement", y=n,
                           fill = "Traitement",
                           colour="Traitement"),alpha=0.3, linewidth = 0) +
    theme_light()+
    theme(legend.position = "none")+
    ylab(paste(n))+
    scale_color_manual(
      values = c("#648FFF", "#FE6100"))+
    scale_fill_manual(
      values = c("#648FFF", "#FE6100"))
  #print(plot_list[[n]])
}

wrap_plots(plot_list[1:4], nrow=2)

Code
wrap_plots(plot_list[5:8], nrow=2)

Code
data_temp2 %>% 
  tbl_summary(
    include = loop.list2,
    by=Traitement,
    type = loop.list2 ~ "continuous2",
    statistic = all_continuous2() ~ c("{median} ({p25} - {p75}", "{mean} ({sd})"),
    digits = list(
      all_continuous2() ~ 2)
  )

Characteristic

Control
N = 92

Permethrin
N = 92

Prop_time_moving

    Median (Q1 - Q3 0.20 (0.13 - 0.30 0.25 (0.17 - 0.32
    Mean (SD) 0.21 (0.11) 0.26 (0.11)
Traveled_Dist

    Median (Q1 - Q3 51.57 (44.25 - 67.28 56.48 (42.93 - 66.97
    Mean (SD) 59.53 (23.62) 60.05 (24.24)
Traveled_Dist_Moving

    Median (Q1 - Q3 40.27 (34.16 - 53.39 45.44 (35.74 - 54.45
    Mean (SD) 45.62 (18.11) 48.31 (19.10)
Average_Speed

    Median (Q1 - Q3 0.23 (0.15 - 0.34 0.27 (0.19 - 0.37
    Mean (SD) 0.25 (0.12) 0.29 (0.12)
Average_Speed_Moving

    Median (Q1 - Q3 0.89 (0.82 - 1.02 0.89 (0.82 - 1.02
    Mean (SD) 0.95 (0.24) 0.94 (0.19)
Meander_moving

    Median (Q1 - Q3 201.96 (181.22 - 247.28 195.95 (174.05 - 229.74
    Mean (SD) 308.09 (302.97) 258.80 (241.69)
Exploration_absolute_value

    Median (Q1 - Q3 9.83 (9.38 - 10.12 9.83 (9.54 - 10.13
    Mean (SD) 9.75 (0.45) 9.79 (0.49)
End_seq

    Median (Q1 - Q3 242.55 (160.15 - 395.95 216.85 (147.50 - 310.25
    Mean (SD) 338.86 (293.27) 255.21 (156.69)

90% exploration to the end of recording

Code
data_temp3 <- data_LAM_vid %>% filter(Prop_time_lost < 0.20 &
             Sequence == "Seq_all") %>% mutate(Lseq=End_seq-Beginning_seq)


loop.list3 <- c("Prop_time_moving", "Traveled_Dist", "Traveled_Dist_Moving", "Average_Speed", "Average_Speed_Moving", 
                "Meander_moving", "Exploration_absolute_value", "Lseq")


# loop.list3 <- c("Latency", "Prop_time_inside", "Time_inside", "Nb_entries", "Prop_time_moving", "Traveled_Dist", "Traveled_Dist_Moving", "Average_Speed", "Average_Speed_moving", 
#                 "Meander_moving", "Exploration_absolute_value", "Lseq")


plot_list <- list()

for (n in loop.list3)
{
  plot_list[[n]] <- 
    ggplot(data_temp3)+
    geom_jitter(aes_string(x="Traitement", y=n, color="Traitement")) +
    geom_boxplot(aes_string(x="Traitement", y=n, color="Traitement"), width = 0.15, position = position_dodge(0.9)) +
    geom_violin(aes_string(x="Traitement", y=n,
                           fill = "Traitement",
                           colour="Traitement"),alpha=0.3, linewidth = 0) +
    theme_light()+
    theme(legend.position = "none")+
    ylab(paste(n))+
    scale_color_manual(
      values = c("#648FFF", "#FE6100"))+
    scale_fill_manual(
      values = c("#648FFF", "#FE6100"))
  #print(plot_list[[n]])
}

wrap_plots(plot_list[1:4], nrow=2)

Code
wrap_plots(plot_list[5:8], nrow=2)

Code
data_temp3 %>% 
  tbl_summary(
    include = loop.list3,
    by=Traitement,
    type = loop.list3 ~ "continuous2",
    statistic = all_continuous2() ~ c("{median} ({p25} - {p75}", "{mean} ({sd})"),
    digits = list(
      all_continuous2() ~ 2)
  )

Characteristic

Control
N = 92

Permethrin
N = 93

Prop_time_moving

    Median (Q1 - Q3 0.29 (0.23 - 0.37 0.30 (0.22 - 0.36
    Mean (SD) 0.30 (0.10) 0.30 (0.09)
Traveled_Dist

    Median (Q1 - Q3 1,131.27 (890.04 - 1,473.33 1,082.69 (786.44 - 1,462.91
    Mean (SD) 1,189.40 (449.36) 1,164.88 (440.36)
Traveled_Dist_Moving

    Median (Q1 - Q3 973.58 (761.12 - 1,294.32 930.44 (657.74 - 1,269.84
    Mean (SD) 1,037.57 (431.92) 1,008.28 (420.73)
Average_Speed

    Median (Q1 - Q3 0.37 (0.29 - 0.46 0.36 (0.26 - 0.45
    Mean (SD) 0.38 (0.13) 0.36 (0.13)
Average_Speed_Moving

    Median (Q1 - Q3 1.07 (1.00 - 1.21 1.04 (0.95 - 1.16
    Mean (SD) 1.10 (0.17) 1.05 (0.17)
Meander_moving

    Median (Q1 - Q3 202.25 (185.89 - 222.18 196.24 (183.33 - 211.55
    Mean (SD) 272.52 (220.61) 243.98 (190.11)
Exploration_absolute_value

    Median (Q1 - Q3 10.86 (10.28 - 11.22 10.91 (10.43 - 11.23
    Mean (SD) 10.77 (0.51) 10.83 (0.53)
Lseq

    Median (Q1 - Q3 3,357.45 (3,204.05 - 3,439.85 3,379.50 (3,290.20 - 3,447.60
    Mean (SD) 3,261.14 (293.27) 3,343.71 (155.85)

Univariate analysis

Analysis of impact of permethrin exposition on each parameters calculated.

Parameters 90% exploration

Parameters that we can consider they follow a gaussian (approx) for parameters extracted from 90% needed to explore environement. Given the mean estimation and SD, statistical test are almost not needed to confirm that there are no difference between groups. I have just done lm or glm for code simplicity, but classic t-test or equivalent are also an option.

Code
library(glmmTMB)
library(broom.mixed)

data_glm <- data_temp2 %>% 
  mutate_if(is.character, as.factor)

data_glm %>% 
  dplyr::select(loop.list2[-1]) %>%  # enleve la var binomiale
  map(~hist(.x), xlab=.x)

$Traveled_Dist
$breaks
[1]  20  40  60  80 100 120 140 160 180

$counts
[1] 29 87 43  9 10  5  0  1

$density
[1] 0.0078804348 0.0236413043 0.0116847826 0.0024456522 0.0027173913
[6] 0.0013586957 0.0000000000 0.0002717391

$mids
[1]  30  50  70  90 110 130 150 170

$xname
[1] ".x"

$equidist
[1] TRUE

attr(,"class")
[1] "histogram"

$Traveled_Dist_Moving
$breaks
[1]   0  20  40  60  80 100 120 140

$counts
[1]  3 75 76 17  9  3  1

$density
[1] 0.0008152174 0.0203804348 0.0206521739 0.0046195652 0.0024456522
[6] 0.0008152174 0.0002717391

$mids
[1]  10  30  50  70  90 110 130

$xname
[1] ".x"

$equidist
[1] TRUE

attr(,"class")
[1] "histogram"

$Average_Speed
$breaks
[1] 0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8

$counts
[1]  8 51 58 40 19  5  2  1

$density
[1] 0.43478261 2.77173913 3.15217391 2.17391304 1.03260870 0.27173913 0.10869565
[8] 0.05434783

$mids
[1] 0.05 0.15 0.25 0.35 0.45 0.55 0.65 0.75

$xname
[1] ".x"

$equidist
[1] TRUE

attr(,"class")
[1] "histogram"

$Average_Speed_Moving
$breaks
 [1] 0.4 0.6 0.8 1.0 1.2 1.4 1.6 1.8 2.0 2.2 2.4 2.6

$counts
 [1]  2 34 97 36  6  7  1  0  0  0  1

$density
 [1] 0.05434783 0.92391304 2.63586957 0.97826087 0.16304348 0.19021739
 [7] 0.02717391 0.00000000 0.00000000 0.00000000 0.02717391

$mids
 [1] 0.5 0.7 0.9 1.1 1.3 1.5 1.7 1.9 2.1 2.3 2.5

$xname
[1] ".x"

$equidist
[1] TRUE

attr(,"class")
[1] "histogram"

$Meander_moving
$breaks
[1]    0  200  400  600  800 1000 1200 1400 1600

$counts
[1] 92 76  0  2  3  3  6  2

$density
[1] 2.500000e-03 2.065217e-03 0.000000e+00 5.434783e-05 8.152174e-05
[6] 8.152174e-05 1.630435e-04 5.434783e-05

$mids
[1]  100  300  500  700  900 1100 1300 1500

$xname
[1] ".x"

$equidist
[1] TRUE

attr(,"class")
[1] "histogram"

$Exploration_absolute_value
$breaks
 [1]  8.6  8.8  9.0  9.2  9.4  9.6  9.8 10.0 10.2 10.4 10.6 10.8 11.0 11.2

$counts
 [1]  3  6  7 29 36  0 41 35  5 14  6  0  2

$density
 [1] 0.08152174 0.16304348 0.19021739 0.78804348 0.97826087 0.00000000
 [7] 1.11413043 0.95108696 0.13586957 0.38043478 0.16304348 0.00000000
[13] 0.05434783

$mids
 [1]  8.7  8.9  9.1  9.3  9.5  9.7  9.9 10.1 10.3 10.5 10.7 10.9 11.1

$xname
[1] ".x"

$equidist
[1] TRUE

attr(,"class")
[1] "histogram"

$End_seq
$breaks
 [1]    0  200  400  600  800 1000 1200 1400 1600 1800 2000 2200

$counts
 [1] 79 69 16 13  5  1  0  0  0  0  1

$density
 [1] 2.146739e-03 1.875000e-03 4.347826e-04 3.532609e-04 1.358696e-04
 [6] 2.717391e-05 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00
[11] 2.717391e-05

$mids
 [1]  100  300  500  700  900 1100 1300 1500 1700 1900 2100

$xname
[1] ".x"

$equidist
[1] TRUE

attr(,"class")
[1] "histogram"
Code
RLS_table <- data_glm %>% 
  dplyr::select(loop.list2[-1]) %>%  # enleve la var binomiale
  map(~glmmTMB(.x ~ Traitement, data = data_glm))%>% 
  map_dfr(~tidy(., effects = "fixed"), .id = 'source')%>% 
 dplyr::filter(term!="(Intercept)") %>% 
  arrange(p.value) %>% 
  kbl(caption = "Coefficient of linear model for each parameters", booktabs = T) %>%
    kable_styling(full_width = T)

RLS_table
Coefficient of linear model for each parameters
source effect component term estimate std.error statistic p.value
End_seq fixed cond TraitementPermethrin -83.6521625 34.4767125 -2.4263381 0.0152521
Average_Speed fixed cond TraitementPermethrin 0.0429863 0.0178336 2.4104030 0.0159349
Meander_moving fixed cond TraitementPermethrin -49.2863855 40.1860576 -1.2264549 0.2200276
Traveled_Dist_Moving fixed cond TraitementPermethrin 2.6883884 2.7294162 0.9849683 0.3246396
Exploration_absolute_value fixed cond TraitementPermethrin 0.0410657 0.0688180 0.5967286 0.5506886
Average_Speed_Moving fixed cond TraitementPermethrin -0.0103842 0.0316010 -0.3286040 0.7424550
Traveled_Dist fixed cond TraitementPermethrin 0.5188934 3.5091352 0.1478693 0.8824459
Code
RLS_table2 <- data_glm %>% 
  dplyr::select(loop.list2) %>%  # enleve la var binomiale
  map(~wilcox.test(.x ~ Traitement, data = data_glm))%>% 
  map_dfr(~tidy(., effects = "fixed"), .id = 'source')%>% 
 #dplyr::filter(term!="(Intercept)") %>% 
  arrange(p.value) %>% 
  kbl(caption = "Coefficient of Mann-Whitney for each parameters", booktabs = T) %>%
    kable_styling(full_width = T)

RLS_table2
Coefficient of Mann-Whitney for each parameters
source statistic p.value method alternative
Prop_time_moving 3177.0 0.0035093 Wilcoxon rank sum test with continuity correction two.sided
Average_Speed 3366.0 0.0165758 Wilcoxon rank sum test with continuity correction two.sided
End_seq 4816.5 0.1059426 Wilcoxon rank sum test with continuity correction two.sided
Traveled_Dist_Moving 3765.0 0.1965570 Wilcoxon rank sum test with continuity correction two.sided
Meander_moving 4549.0 0.3809351 Wilcoxon rank sum test with continuity correction two.sided
Exploration_absolute_value 4055.5 0.6260826 Wilcoxon rank sum test with continuity correction two.sided
Traveled_Dist 4078.0 0.6708821 Wilcoxon rank sum test with continuity correction two.sided
Average_Speed_Moving 4287.0 0.8800754 Wilcoxon rank sum test with continuity correction two.sided

Binomial variable : prop_time moving

Code
# glm 
PTM <- glmmTMB(Prop_time_moving~Traitement, data=data_glm, family=binomial(link = "logit"))
summary(PTM)
 Family: binomial  ( logit )
Formula:          Prop_time_moving ~ Traitement
Data: data_glm

     AIC      BIC   logLik deviance df.resid 
   204.1    210.6   -100.1    200.1      182 


Conditional model:
                     Estimate Std. Error z value Pr(>|z|)    
(Intercept)           -1.3130     0.2551  -5.147 2.64e-07 ***
TraitementPermethrin   0.2575     0.3490   0.738    0.461    
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

For the time needed to explore 90% of the surface, that could be considered as acclimation of exploration period, a difference between group is only evidenced for proportion of time moving and Average speed. Permethrin exposed individual seems to move more often and faster than individual only exposed to water.

Parameters for 90% of exploration to the end of the recording.

Code
data_temp3 <- data_temp3%>% 
  mutate_if(is.character, as.factor)

data_temp3 %>% 
  dplyr::select(loop.list3) %>%  # enleve la var binomiale
  map(~hist(.x), xlab=.x)

$Prop_time_moving
$breaks
 [1] 0.05 0.10 0.15 0.20 0.25 0.30 0.35 0.40 0.45 0.50 0.55 0.60

$counts
 [1]  2  7 20 31 37 33 27 18  6  3  1

$density
 [1] 0.2162162 0.7567568 2.1621622 3.3513514 4.0000000 3.5675676 2.9189189
 [8] 1.9459459 0.6486486 0.3243243 0.1081081

$mids
 [1] 0.075 0.125 0.175 0.225 0.275 0.325 0.375 0.425 0.475 0.525 0.575

$xname
[1] ".x"

$equidist
[1] TRUE

attr(,"class")
[1] "histogram"

$Traveled_Dist
$breaks
[1]    0  500 1000 1500 2000 2500 3000

$counts
[1]  6 61 76 36  4  2

$density
[1] 6.486486e-05 6.594595e-04 8.216216e-04 3.891892e-04 4.324324e-05
[6] 2.162162e-05

$mids
[1]  250  750 1250 1750 2250 2750

$xname
[1] ".x"

$equidist
[1] TRUE

attr(,"class")
[1] "histogram"

$Traveled_Dist_Moving
$breaks
 [1]    0  200  400  600  800 1000 1200 1400 1600 1800 2000 2200 2400 2600 2800

$counts
 [1]  2  4 23 34 34 29 27 13 12  3  2  0  1  1

$density
 [1] 5.405405e-05 1.081081e-04 6.216216e-04 9.189189e-04 9.189189e-04
 [6] 7.837838e-04 7.297297e-04 3.513514e-04 3.243243e-04 8.108108e-05
[11] 5.405405e-05 0.000000e+00 2.702703e-05 2.702703e-05

$mids
 [1]  100  300  500  700  900 1100 1300 1500 1700 1900 2100 2300 2500 2700

$xname
[1] ".x"

$equidist
[1] TRUE

attr(,"class")
[1] "histogram"

$Average_Speed
$breaks
 [1] 0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9

$counts
[1]  2 12 44 57 42 19  7  1  1

$density
[1] 0.10810811 0.64864865 2.37837838 3.08108108 2.27027027 1.02702703 0.37837838
[8] 0.05405405 0.05405405

$mids
[1] 0.05 0.15 0.25 0.35 0.45 0.55 0.65 0.75 0.85

$xname
[1] ".x"

$equidist
[1] TRUE

attr(,"class")
[1] "histogram"

$Average_Speed_Moving
$breaks
 [1] 0.6 0.7 0.8 0.9 1.0 1.1 1.2 1.3 1.4 1.5 1.6 1.7

$counts
 [1]  1  5 20 34 56 27 25 11  3  2  1

$density
 [1] 0.05405405 0.27027027 1.08108108 1.83783784 3.02702703 1.45945946
 [7] 1.35135135 0.59459459 0.16216216 0.10810811 0.05405405

$mids
 [1] 0.65 0.75 0.85 0.95 1.05 1.15 1.25 1.35 1.45 1.55 1.65

$xname
[1] ".x"

$equidist
[1] TRUE

attr(,"class")
[1] "histogram"

$Meander_moving
$breaks
 [1]  100  200  300  400  500  600  700  800  900 1000 1100

$counts
 [1] 99 70  1  0  0  0  2  3  5  5

$density
 [1] 5.351351e-03 3.783784e-03 5.405405e-05 0.000000e+00 0.000000e+00
 [6] 0.000000e+00 1.081081e-04 1.621622e-04 2.702703e-04 2.702703e-04

$mids
 [1]  150  250  350  450  550  650  750  850  950 1050

$xname
[1] ".x"

$equidist
[1] TRUE

attr(,"class")
[1] "histogram"

$Exploration_absolute_value
$breaks
[1]  9.0  9.5 10.0 10.5 11.0 11.5 12.0 12.5

$counts
[1]  1 15 38 70 41 18  2

$density
[1] 0.01081081 0.16216216 0.41081081 0.75675676 0.44324324 0.19459459 0.02162162

$mids
[1]  9.25  9.75 10.25 10.75 11.25 11.75 12.25

$xname
[1] ".x"

$equidist
[1] TRUE

attr(,"class")
[1] "histogram"

$Lseq
$breaks
 [1] 1400 1600 1800 2000 2200 2400 2600 2800 3000 3200 3400 3600

$counts
 [1]  1  0  0  0  0  1  5 13 16 70 79

$density
 [1] 2.702703e-05 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00
 [6] 2.702703e-05 1.351351e-04 3.513514e-04 4.324324e-04 1.891892e-03
[11] 2.135135e-03

$mids
 [1] 1500 1700 1900 2100 2300 2500 2700 2900 3100 3300 3500

$xname
[1] ".x"

$equidist
[1] TRUE

attr(,"class")
[1] "histogram"
Code
#loop.list2 <- names(data_temp2[, c(9:12,14:18,20,21,29)])

RLS_table_3 <- data_temp3 %>% 
  dplyr::select(loop.list3[-1]) %>%  # enleve la var binomiale
  map(~glmmTMB(.x ~ Traitement, data = data_temp3))%>% 
  map_dfr(~tidy(., effects = "fixed"), .id = 'source')%>% 
 dplyr::filter(term!="(Intercept)") %>% 
  arrange(p.value) %>% 
  kbl(caption = "Coefficient of linear model for each parameters (90% explo)", booktabs = T) %>%
    kable_styling(full_width = T)

RLS_table_3
Coefficient of linear model for each parameters (90% explo)
source effect component term estimate std.error statistic p.value
Lseq fixed cond TraitementPermethrin 82.5695830 34.2915280 2.4078712 0.0160458
Average_Speed_Moving fixed cond TraitementPermethrin -0.0446108 0.0246993 -1.8061572 0.0708938
Meander_moving fixed cond TraitementPermethrin -28.5424341 30.1041145 -0.9481240 0.3430663
Average_Speed fixed cond TraitementPermethrin -0.0148152 0.0187485 -0.7902059 0.4294075
Exploration_absolute_value fixed cond TraitementPermethrin 0.0555313 0.0765038 0.7258634 0.4679225
Traveled_Dist_Moving fixed cond TraitementPermethrin -29.2923343 62.3497095 -0.4698071 0.6384929
Traveled_Dist fixed cond TraitementPermethrin -24.5269235 65.0602430 -0.3769879 0.7061826
Code
RLS_table3b <- data_temp3 %>% 
  dplyr::select(loop.list3) %>%  # enleve la var binomiale
  map(~wilcox.test(.x ~ Traitement, data = data_temp3))%>% 
  map_dfr(~tidy(., effects = "fixed"), .id = 'source')%>% 
 #dplyr::filter(term!="(Intercept)") %>% 
  arrange(p.value) %>% 
  kbl(caption = "Coefficient of Mann-Whitney for each parameters", booktabs = T) %>%
    kable_styling(full_width = T)

RLS_table3b
Coefficient of Mann-Whitney for each parameters
source statistic p.value method alternative
Average_Speed_Moving 4985.0 0.0523747 Wilcoxon rank sum test with continuity correction two.sided
Meander_moving 4847.0 0.1185014 Wilcoxon rank sum test with continuity correction two.sided
Lseq 3719.5 0.1254577 Wilcoxon rank sum test with continuity correction two.sided
Average_Speed 4622.0 0.3455545 Wilcoxon rank sum test with continuity correction two.sided
Traveled_Dist_Moving 4529.0 0.4915345 Wilcoxon rank sum test with continuity correction two.sided
Exploration_absolute_value 4050.5 0.5324192 Wilcoxon rank sum test with continuity correction two.sided
Traveled_Dist 4492.0 0.5576950 Wilcoxon rank sum test with continuity correction two.sided
Prop_time_moving 4329.0 0.8897090 Wilcoxon rank sum test with continuity correction two.sided

Prop time moving :

Code
PTM2 <- glmmTMB(Prop_time_moving~Traitement, data=data_temp3, family=binomial(link = "logit"))
summary(PTM2)
 Family: binomial  ( logit )
Formula:          Prop_time_moving ~ Traitement
Data: data_temp3

     AIC      BIC   logLik deviance df.resid 
   229.2    235.7   -112.6    225.2      183 


Conditional model:
                     Estimate Std. Error z value Pr(>|z|)    
(Intercept)          -0.85285    0.22776  -3.744 0.000181 ***
TraitementPermethrin -0.01246    0.32164  -0.039 0.969104    
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Border zone analysis

90 % exploration

In this part are presented metrics for only the period taken to explore 90% of the area. As previously, individual with more than 20% of time lost are removed.

Code
data_temp2_sp <- data_LAM_vid_spatial %>% filter(Prop_time_lost < 0.20 &
             Sequence == "Seq_90")


loop.list2_sp <- c("Latency", "Prop_time_inside", "Time_inside", "Nb_entries", "Prop_time_moving", "Traveled_Dist", "Traveled_Dist_Moving", "Average_Speed", "Average_Speed_moving",
               "Meander_moving", "Exploration_absolute_value")


plot_list <- list()

for (n in loop.list2_sp)
{
  plot_list[[n]] <- 
    ggplot(data_temp2_sp)+
    geom_jitter(aes_string(x="Traitement", y=n, color="Traitement")) +
    geom_boxplot(aes_string(x="Traitement", y=n, color="Traitement"), width = 0.15, position = position_dodge(0.9)) +
    geom_violin(aes_string(x="Traitement", y=n,
                           fill = "Traitement",
                           colour="Traitement"),alpha=0.3, linewidth = 0) +
    theme_light()+
    theme(legend.position = "none")+
    ylab(paste(n))+
    scale_color_manual(
      values = c("#648FFF", "#FE6100"))+
    scale_fill_manual(
      values = c("#648FFF", "#FE6100"))
  #print(plot_list[[n]])
}

wrap_plots(plot_list[1:6], nrow=2)

Code
wrap_plots(plot_list[7:11], nrow=2)

Code
data_temp2_sp %>% 
  tbl_summary(
    include = loop.list2_sp,
    by=Traitement,
    type = loop.list2_sp ~ "continuous2",
    statistic = all_continuous2() ~ c("{median} ({p25} - {p75}", "{mean} ({sd})"),
    digits = list(
      all_continuous2() ~ 2)
  )

Characteristic

Control
N = 85

Permethrin
N = 82

Latency

    Median (Q1 - Q3 12.40 (1.20 - 30.60 10.80 (3.60 - 22.90
    Mean (SD) 43.20 (95.63) 23.18 (34.57)
Prop_time_inside

    Median (Q1 - Q3 0.10 (0.05 - 0.21 0.09 (0.05 - 0.21
    Mean (SD) 0.17 (0.17) 0.15 (0.15)
Time_inside

    Median (Q1 - Q3 22.60 (10.20 - 53.60 18.10 (10.80 - 39.30
    Mean (SD) 45.44 (64.27) 29.26 (27.49)
Nb_entries

    Median (Q1 - Q3 17.00 (12.00 - 22.00 16.00 (11.00 - 21.00
    Mean (SD) 17.98 (9.44) 17.41 (9.29)
Prop_time_moving

    Median (Q1 - Q3 0.36 (0.19 - 0.60 0.40 (0.25 - 0.56
    Mean (SD) 0.40 (0.25) 0.42 (0.21)
Traveled_Dist

    Median (Q1 - Q3 6.59 (3.50 - 10.27 5.52 (3.66 - 8.96
    Mean (SD) 7.87 (6.12) 7.04 (4.89)
Traveled_Dist_Moving

    Median (Q1 - Q3 5.00 (2.84 - 7.98 4.84 (3.03 - 7.50
    Mean (SD) 5.96 (4.41) 5.70 (3.97)
Average_Speed

    Median (Q1 - Q3 0.36 (0.20 - 0.52 0.38 (0.23 - 0.52
    Mean (SD) 0.39 (0.23) 0.42 (0.26)
Average_Speed_moving

    Median (Q1 - Q3 0.75 (0.66 - 0.88 0.76 (0.66 - 0.92
    Mean (SD) 0.81 (0.23) 0.80 (0.22)
Meander_moving

    Median (Q1 - Q3 282.54 (209.53 - 422.02 294.74 (212.62 - 400.38
    Mean (SD) 409.81 (378.09) 360.00 (277.88)
Exploration_absolute_value

    Median (Q1 - Q3 9.83 (9.38 - 10.11 9.83 (9.54 - 10.13
    Mean (SD) 9.76 (0.45) 9.78 (0.49)

90% exploration to the end of recording

Code
data_temp3_sp <- data_LAM_vid_spatial %>% filter(Prop_time_lost < 0.20 &
             Sequence == "Seq_all")


plot_list <- list()

for (n in loop.list2_sp)
{
  plot_list[[n]] <- 
    ggplot(data_temp3_sp)+
    geom_jitter(aes_string(x="Traitement", y=n, color="Traitement")) +
    geom_boxplot(aes_string(x="Traitement", y=n, color="Traitement"), width = 0.15, position = position_dodge(0.9)) +
    geom_violin(aes_string(x="Traitement", y=n,
                           fill = "Traitement",
                           colour="Traitement"),alpha=0.3, linewidth = 0) +
    theme_light()+
    theme(legend.position = "none")+
    ylab(paste(n))+
    scale_color_manual(
      values = c("#648FFF", "#FE6100"))+
    scale_fill_manual(
      values = c("#648FFF", "#FE6100"))
  #print(plot_list[[n]])
}

wrap_plots(plot_list[1:6], nrow=2)

Code
wrap_plots(plot_list[7:11], nrow=2)

Code
data_temp3_sp %>% 
  tbl_summary(
    include = loop.list2_sp,
    by=Traitement,
    type = loop.list2_sp ~ "continuous2",
    statistic = all_continuous2() ~ c("{median} ({p25} - {p75}", "{mean} ({sd})"),
    digits = list(
      all_continuous2() ~ 2)
  )

Characteristic

Control
N = 89

Permethrin
N = 84

Latency

    Median (Q1 - Q3 3.50 (0.10 - 10.10 1.75 (0.05 - 8.90
    Mean (SD) 9.84 (21.11) 9.04 (17.99)
Prop_time_inside

    Median (Q1 - Q3 0.12 (0.07 - 0.23 0.12 (0.07 - 0.19
    Mean (SD) 0.16 (0.12) 0.16 (0.13)
Time_inside

    Median (Q1 - Q3 367.30 (212.70 - 769.90 389.10 (223.70 - 638.25
    Mean (SD) 522.41 (416.04) 524.66 (429.38)
Nb_entries

    Median (Q1 - Q3 340.00 (247.00 - 467.00 320.50 (218.50 - 441.00
    Mean (SD) 357.38 (169.22) 339.69 (159.58)
Prop_time_moving

    Median (Q1 - Q3 0.28 (0.24 - 0.36 0.29 (0.22 - 0.36
    Mean (SD) 0.29 (0.10) 0.29 (0.10)
Traveled_Dist

    Median (Q1 - Q3 128.02 (84.81 - 230.27 128.01 (65.56 - 202.20
    Mean (SD) 153.55 (95.20) 146.64 (114.06)
Traveled_Dist_Moving

    Median (Q1 - Q3 109.13 (70.83 - 188.02 109.94 (50.97 - 169.38
    Mean (SD) 131.36 (82.35) 124.64 (100.14)
Average_Speed

    Median (Q1 - Q3 0.47 (0.28 - 0.59 0.41 (0.29 - 0.54
    Mean (SD) 0.46 (0.21) 0.42 (0.19)
Average_Speed_moving

    Median (Q1 - Q3 0.86 (0.79 - 0.97 0.85 (0.77 - 0.97
    Mean (SD) 0.91 (0.20) 0.88 (0.16)
Meander_moving

    Median (Q1 - Q3 308.05 (269.01 - 347.93 302.98 (264.78 - 354.71
    Mean (SD) 369.92 (195.87) 338.15 (141.39)
Exploration_absolute_value

    Median (Q1 - Q3 10.88 (10.28 - 11.22 10.91 (10.28 - 11.23
    Mean (SD) 10.78 (0.51) 10.80 (0.53)

Univariate analysis

90% exploration in border zone

Code
library(glmmTMB)
library(broom.mixed)

data_glm_sp <- data_temp2_sp %>% 
  mutate_if(is.character, as.factor)

RLS_table_sp <- data_glm_sp %>% 
  dplyr::select(loop.list2_sp) %>%  # enleve la var binomiale
  map(~wilcox.test(.x ~ Traitement, data = data_glm_sp))%>% 
  map_dfr(~tidy(., effects = "fixed"), .id = 'source')%>% 
 #dplyr::filter(term!="(Intercept)") %>% 
  arrange(p.value) %>% 
  kbl(caption = "Coefficient of Mann-Whitney for each parameters", booktabs = T) %>%
    kable_styling(full_width = T)

RLS_table_sp
Coefficient of Mann-Whitney for each parameters
source statistic p.value method alternative
Time_inside 3728.0 0.4375629 Wilcoxon rank sum test with continuity correction two.sided
Prop_time_moving 3249.5 0.4518712 Wilcoxon rank sum test with continuity correction two.sided
Average_Speed 3261.0 0.4743129 Wilcoxon rank sum test with continuity correction two.sided
Traveled_Dist 3667.0 0.5612223 Wilcoxon rank sum test with continuity correction two.sided
Nb_entries 3627.0 0.6502245 Wilcoxon rank sum test with continuity correction two.sided
Traveled_Dist_Moving 3577.0 0.7695876 Wilcoxon rank sum test with continuity correction two.sided
Exploration_absolute_value 3408.0 0.8065276 Wilcoxon rank sum test with continuity correction two.sided
Prop_time_inside 3552.0 0.8314181 Wilcoxon rank sum test with continuity correction two.sided
Meander_moving 3436.0 0.8766159 Wilcoxon rank sum test with continuity correction two.sided
Latency 3499.0 0.9654701 Wilcoxon rank sum test with continuity correction two.sided
Average_Speed_moving 3496.0 0.9731857 Wilcoxon rank sum test with continuity correction two.sided

90% exploration to the end in border zone

Code
data_glm_sp3 <- data_temp3_sp %>% 
  mutate_if(is.character, as.factor)


RLS_table3_sp <- data_glm_sp3 %>% 
  dplyr::select(loop.list2_sp) %>%  # enleve la var binomiale
  map(~wilcox.test(.x ~ Traitement, data = data_glm_sp3))%>% 
  map_dfr(~tidy(., effects = "fixed"), .id = 'source')%>% 
 #dplyr::filter(term!="(Intercept)") %>% 
  arrange(p.value) %>% 
  kbl(caption = "Coefficient of Mann-Whitney for each parameters", booktabs = T) %>%
    kable_styling(full_width = T)

RLS_table3_sp
Coefficient of Mann-Whitney for each parameters
source statistic p.value method alternative
Average_Speed 4178.0 0.1819176 Wilcoxon rank sum test with continuity correction two.sided
Traveled_Dist_Moving 4062.0 0.3258279 Wilcoxon rank sum test with continuity correction two.sided
Traveled_Dist 4049.0 0.3456462 Wilcoxon rank sum test with continuity correction two.sided
Average_Speed_moving 4031.0 0.3743271 Wilcoxon rank sum test with continuity correction two.sided
Nb_entries 4024.0 0.3858623 Wilcoxon rank sum test with continuity correction two.sided
Latency 4011.5 0.4035998 Wilcoxon rank sum test with continuity correction two.sided
Meander_moving 3967.0 0.4876741 Wilcoxon rank sum test with continuity correction two.sided
Prop_time_moving 3665.0 0.8257146 Wilcoxon rank sum test with continuity correction two.sided
Exploration_absolute_value 3674.0 0.8468037 Wilcoxon rank sum test with continuity correction two.sided
Prop_time_inside 3796.0 0.8613608 Wilcoxon rank sum test with continuity correction two.sided
Time_inside 3723.0 0.9648724 Wilcoxon rank sum test with continuity correction two.sided

For movement around the border, any significant difference between groups have been evidenced for all parameters tested. I choose to apply only wilcoxon as data do not fit gaussian distrib.

Multivariate analysis

I apply mutlivariate analysis only on all zone exploration.

Relation between co-variable

Correlation

Code
library(corrplot)
col <- colorRampPalette(c("#BB4444", "#EE9988", "#FFFFFF", "#77AADD", "#4477AA"))

data_LAM_vid %>% filter(Sequence=="General") %>% select(all_of(loop.list)) %>% cor() %>% 
  corrplot(method="color", col=col(200),
             type="upper", order="hclust")

Code
data_temp2 %>% filter(Sequence=="Seq_90") %>%  select(all_of(loop.list2)) %>% cor() %>% 
  corrplot(method="color", col=col(200),
             type="upper",order="hclust")

Code
data_temp3 %>% filter(Sequence=="Seq_all") %>%  select(all_of(loop.list3)) %>% cor() %>% 
  corrplot(method="color", col=col(200),
             type="upper", order="hclust")

ACP

1st graph : 90% of exploration. 2nd graph : 90% of exploration without outlier values of meander 3tr graph : 90% to the end.

Co variable relation.

Code
library(corrplot)

df_ACP<- data_temp2 %>% select(c(all_of(loop.list2),"Traitement", "sexe")) %>% 
  mutate_if(is.character, as.factor)

df_ACP %>% plot()

Code
# drop absurd values of meander (pb of parameter estimation to check)
df_ACPb<- data_temp2 %>% filter(Meander<10000) %>% select(c(all_of(loop.list2),"Traitement", "sexe")) %>% 
  mutate_if(is.character, as.factor)

df_ACPb %>% plot()

Code
df_ACP3<- data_temp3 %>% select(c(all_of(loop.list3),"Traitement", "sexe")) %>% 
  mutate_if(is.character, as.factor)

df_ACP3 %>% plot()

Code
pca1<-PCA(df_ACP[,-c(9,10)], graph=FALSE)
pca1b<-PCA(df_ACPb[,-c(9,10)], graph=FALSE)
pca3<-PCA(df_ACP3[,-c(9,10)], graph=FALSE)

# ACP1 <- res_by_ind %>% filter(Sequence=="General"& Prop_time_lost<0.2) %>% select(c(all_of(loop.list),"Traitement")) %>% 
#   mutate_if(is.character, as.factor) %>% PCA()

#ACP2<- res_by_ind_spatial %>% filter(Sequence=="Seq_0" & Prop_time_lost<0.2) %>% select(all_of(loop.list2)) %>% PCA()
Code
fviz_eig(pca1, addlabels = TRUE) 

Code
res <- get_pca_var(pca1)
corrplot(res$cos2)

Code
fviz_eig(pca1b, addlabels = TRUE) 

Code
res2 <- get_pca_var(pca1b)
corrplot(res2$cos2)

Code
fviz_eig(pca3, addlabels = TRUE) 

Code
res3 <- get_pca_var(pca3)
corrplot(res3$cos2)

Variable representation :

Code
fviz_pca_var(pca1, col.var="contrib",
             gradient.cols = c("#00AFBB", "#E7B800", "#FC4E07"),
             repel = TRUE # Avoid text overlapping
             )

Code
fviz_pca_var(pca1b, col.var="contrib",
             gradient.cols = c("#00AFBB", "#E7B800", "#FC4E07"),
             repel = TRUE # Avoid text overlapping
             )

Code
fviz_pca_var(pca3, col.var="contrib",
             gradient.cols = c("#00AFBB", "#E7B800", "#FC4E07"),
             repel = TRUE # Avoid text overlapping
             )

Separation by treatment

Individual representation :

Code
fviz_pca_ind(pca1,
             label = "none", # hide individual labels
             habillage =  df_ACP$Traitement, # color by groups
             palette = c("#00AFBB", "#FC4E07"),
             addEllipses = TRUE # Concentration ellipses
             )

Code
fviz_pca_ind(pca1b,
             label = "none", # hide individual labels
             habillage =  df_ACPb$Traitement, # color by groups
             palette = c("#00AFBB", "#FC4E07"),
             addEllipses = TRUE # Concentration ellipses
             )

Code
fviz_pca_ind(pca3,
             label = "none", # hide individual labels
             habillage =  df_ACP3$Traitement, # color by groups
             palette = c("#00AFBB", "#FC4E07"),
             addEllipses = TRUE # Concentration ellipses
             )

Separation by sexe

Code
fviz_pca_ind(pca1,
             label = "none", # hide individual labels
             habillage =  df_ACP$sexe, # color by groups
             palette = c("#00AFBB", "#FC4E07"),
             addEllipses = TRUE # Concentration ellipses
             )

Code
fviz_pca_ind(pca1b,
             label = "none", # hide individual labels
             habillage =  df_ACPb$sexe, # color by groups
             palette = c("#00AFBB", "#FC4E07"),
             addEllipses = TRUE # Concentration ellipses
             )

Code
fviz_pca_ind(pca3,
             label = "none", # hide individual labels
             habillage =  df_ACP3$sexe, # color by groups
             palette = c("#00AFBB", "#FC4E07"),
             addEllipses = TRUE # Concentration ellipses
             )

Interpretation of ACP results :

I retrieve some absurd values (extremely high values) to improve ACP results for 1 hours recording analysis.

Insecticides effect : The insecticide seems not be involved in movement modification with parameter used here.

Description of the movement : for 1 hour recording, it seems that the movement could be divided mainly by the 1st axe that could be resumed by proportion in movement, speed and distance traveled and 2nd axes mainly consider the meander of the movement.

In summary, lazy, sinuous and slow movement vs active, straight and fast movement.

The analysis of navigation of larvae with parameters bring some informations about the characterisation of this type of behaviour. In addition, we could apply classic comparative statistical analysis that allow to compare parameters between groups. Nevertheless, parameters used before are based on a priori/hypothesis of the navigation decomposition and parameters of interest that described the navigation but some information could be hidden besides the time series represented by the position of the larvae during 1hour. Application of data-driven analysis could highlight some properties of navigation strategy of larvae hidden until now. We propose to apply hidden markov model or activity clustering methods to characterise trajectory based on all data set along time.